var arrId,navPos;
advertiserApp.controller("advertiserCtrl",function($scope,$http){
     $scope.msgId = getQueryString("msgId");   
     $scope.flag = getQueryString("flag");  
	 navPos = getQueryString("navPos");		 
	 //获取信件内容;
     $.ajax({  /web-adv/advWeb/views/message/reply.html?selectedNav=6&navPos={{navPos}}&msgId={{arr.id}}
	     type:"post",
		 dataType:"json",
		 url:"/web-adv/readMsgInbox",
		 data:{msgId:$scope.msgId},
		 success:function(data){
		     console.log(data);
			 arrId = data.id;
			 if(data){
			     $("#sender_name,#sender_name2").text(data.sender_name);
			     $("#mail_title").text(data.mail_title);
			     $("#creat_time").text(data.creat_time);
			     $("#addressee_name").text(data.addressee_name);
			     $("#mail_content").html(data.mail_content);
				 //当信件为未读时，标记为已读 
				 if($scope.flag=="未读"){			     
				     $.post("/web-adv/MsgInboxFlag",{msgId:$scope.msgId}).success(function(flagData){
		                 if(flagData.status == "1"){
					     //console.log("已读")
					     }
		             }); 
				 }; 				 
			 }
		 }
	 });   
});
var toReply = function(){     
	 var url = "/web-adv/advWeb/views/message/reply.html?selectedNav=6&navPos="+navPos+"&msgId="+arrId;
     window.location.href=url;
}	 